package com.software.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author wyj
 * @since 2024-03-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("tb_product")
public class ProductBean implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("category_id")
    private Integer categoryId;

    /* 成色
     */
    @TableField("product_quality")
    private String productQuality;

    @TableField("product_price")
    private Double productPrice;

    @TableField("product_status")
    private Integer productStatus;

    @TableField("product_create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date productCreateTime;

    @TableField("product_update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date productUpdateTime;

    @TableField("product_desc")
    private String productDesc;

    @TableField("product_cover_image")
    private String productCoverImage;

    @TableField("customer_id")
    private Integer customerId;

    @TableField(exist = false)
    private CustomerInfoBean customerInfoBean;

    @TableField(exist = false)
    private CategoryBean categoryBean;

    @TableField("is_home")
    private Integer isHome;
}
